package com.liangdemo.web.thread;

/**
 * 线程的基本操作类
 */
public class ThreadDemo1 extends Thread {
    public void run() {
    }

    public static void main(String[] args) {

        ThreadDemo1 t1 = new ThreadDemo1();
        //创建一个线程
        new Thread(() -> {

        });
        System.out.println(t1.isAlive());//查看线程时候为活动状态
        t1.start();//启动线程
        System.out.println(t1.isAlive());
        System.out.println(t1.getId());//获取线程的唯一标识
        t1.setName("线程1");//给线程设置名字
        System.out.println(t1.getName());//获取线程的名字

        t1.setPriority(1);//设置线程的优先级
        System.out.println(t1.getPriority());

    }
}
